package bussinessService.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import utils.DateUtil;
import module.CusProgress;
import bussinessService.cusProgressBussinessService;
import domain.vo.CusProgressVO;
import domain.vo.queryObject;


public class CusProgressBussinessServiceImpl implements cusProgressBussinessService{

	/* (非 Javadoc) 
	* <p>Title: deleteT</p> 
	* <p>Description: </p> 
	* @param id
	* @throws SQLException 
	* @see bussinessService.basicbussinessService#deleteT(int) 
	*/ 

	public void deleteT(int id) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#deleteT(java.lang.Object)
	 */
	public void deleteT(CusProgress t) throws SQLException {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#getAll()
	 */
	public List<CusProgressVO> getAll() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#getById(java.lang.String)
	 */
	public CusProgress getById(String id) throws SQLException {
	
		return cusProgressService.getById(id);
	}

	/* (non-Javadoc)
	 * @see bussinessService.basicbussinessService#merageObject(java.lang.Object)
	 */
	public void merageObject(CusProgress t) throws SQLException {
		cusProgressService.insertObject(t);
		
	}

	
	public int countByQueryObject(queryObject queryObject) throws SQLException {
		return cusProgressService.countByQueryObject(queryObject);
	}

	public List<CusProgressVO> getObjectByQueryObject(queryObject queryObject) throws SQLException {
		List<CusProgress> result = new ArrayList<CusProgress>();
		List<CusProgressVO> vos = new ArrayList<CusProgressVO>();
		result = cusProgressService.getObjectByQueryObject(queryObject);
		for(CusProgress cp : result) {
			CusProgressVO vo = new CusProgressVO();
			vo.setContent(cp.getContent());
			vo.setCp_id(cp.getCp_id());
			vo.setCreateTime(DateUtil.date2String(cp.getCreateTime(), DateUtil.YYYY_MM_DD_HH_mm_ss));
			vo.setE_sn(cp.getE_sn());
			vo.setCus_id(cp.getCus_id());
			vo.setE_name(cp.getE_name());
			vo.setType(cp.getType());
			vos.add(vo);
		}
		return vos;
	}

	


}
